<?php


namespace app\admin\controller;
use app\common\lib;

class Index extends Base
{
    public function index()
    {
        return $this->fetch();
    }

    public function index_v1()
    {
        return $this->fetch();
    }

    public function logout()
    {
        $isLogin = lib\Tools::isLogin();
        if($isLogin) {
            $_login_msg = lib\Tools::get_login_msg($isLogin['id'],'1','退出登录');
            Model('UserLoginMsg')->save($_login_msg);
            session(null,config('tools.session')['session']);
            return $this->success('退出成功','admin/login/index');
        }
        return $this->error('非法操作','admin/login/index');
    }
}